<include file="header"/>
<BODY class="easyui-layout">
 <div id="main_frame" data-options="region:'center',title:'',border:false">
  <div class="easyui-tabs" id="main_frame_tab" data-options="fit:true">
    <div title="WIFI网络列表" data-options="iconCls:''">
		<table id="target_lock_list" class="easyui-datagrid"
				data-options="url:'?g=targetlock-jsondata',striped: true,border:false,multiselected:false,rownumbers:true,singleSelect:true,fitColumns:true,pageList:[20,50],onClickRow: click_row_tar_lock,onLoadSuccess:tar_lock_loadsuccess">
			<thead>
				<tr>
				<th data-options="field:'ESSID',formatter:format_name" width="150"> AP名字</th>
				<th data-options="field:'BSSID',formatter:format_position" width="100"> MAC地址</th>
				<th data-options="field:'speed',formatter:format_add_time" width="50"> 速度</th>
				<th data-options="field:'power',formatter:format_description" width="50"> 信号强度</th>
				<th data-options="field:'cmd',formatter:format_type" width="100"> 接入方式</th>
				<th data-options="field:'status',formatter:format_status" width="100"> 状态</th>
				</tr>
			</thead>
		</table>
    </div>
	</div><!-- End div main_frame_tab -->
 </div><!-- End div main_frame -->
 <div id="main_frame" data-options="region:'south',title:'',border:false" title="相关用户列表" style="height:300px;">
	<table id="acount_list" class="easyui-datagrid"
			data-options="url:'?g=targetlock-client_data',striped: true,singleSelect:true,border:false,rownumbers:true,fitColumns:true,onLoadSuccess: accounut_loadsuccess">
		<thead>
			<tr>
			<th data-options="field:'mac',formatter:format_name" width="150"> MAC地址</th>
			<th data-options="field:'osinfo',formatter:format_position" width="100"> 系统类型</th>
			<th data-options="field:'status',formatter:format_add_time" width="100"> 网络行为</th>
			<th data-options="field:'missing',formatter:format_description" width="100"> 虚拟帐号</th>
			<th data-options="field:'id',formatter: format_related" width="50" align="center"> 关联</th>
			</tr>
		</thead>
	</table>
 </div><!-- End div main_frame -->

<div id="targetlock_win_iframe" class="easyui-window" title="接入方式" data-options="modal:true,closed:true,iconCls:'icon-app'" style="width:540px;height:250px;overflow:hidden;">
	<!--iframe-->
<div class="easyui-layout" data-options="fit:true">
	<div data-options="region:'south',border:false"  style="padding:5px;height:40px;text-align:right;border-top:1px solid #CCC;">		
		<a class="easyui-linkbutton" data-options="iconCls:'icon-confirm'" href="javascript:void(0)" onclick="javascript:return targetlock_form_submit();">确定</a>
		<a class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" href="javascript:void(0)" onclick="javascript:$('#targetlock_win_iframe').window('close');">取消</a>
	</div>
	
	<div data-options="region:'center',border:false" style="padding:20px;">
		<form name="access_form" id="access_form_cid" method="post">
			<div class="sys-msg-info"></div>
			<div class="css_config">
			<table>
			<tr id="conftr_0">
				<td class="label_grp"> </td>
				<td class="css_content"></td>
			</tr>
			<tbody id="group_1">
			  <tr id="conftr_type">
				<td class="label_1" style="width:100px;">接入方式</td>
				<td class="css_content"><span class="check_margin"><input type="radio" name="cmd" id="cmd_1_cid" value="LOGIN" checked>输入密码</span><span class="check_margin"><input type="radio" name="cmd" id="cmd_2_cid" value="CRACK">破解</span><span class="check_margin"><input type="radio" name="cmd" id="cmd_2_cid" value="HONEYAP">蜜罐</span>		</td>
			</tr>
			  <tr id="conftr_passwd">
				<td class="label_1">输入密码</td>
				<td class="css_content"><span class="input_margin"><input type="text" name="passwd" id="passwd_cid" value="" class="input long" style="width:300px;"></span>		</td>
			</tr>
			</tbody><!-- End group group_1 -->
			 </table>
			</div><!-- End css_conf -->
			<input type="hidden" name="BSSID" id="aplist_cid" value="$param[id]">
		</form>
	</div>
</div>
</div>


<div id="relatedtask_win_iframe" class="easyui-window" title="关联任务" data-options="modal:true,closed:true,iconCls:'icon-app'" style="width:500px;height:200px;overflow:hidden;">
	<!--iframe-->
<div class="easyui-layout" data-options="fit:true">
	<div data-options="region:'south',border:false"  style="padding:5px;height:40px;text-align:right;border-top:1px solid #CCC;">		
		<a class="easyui-linkbutton" data-options="iconCls:'icon-confirm'" href="javascript:void(0)" onclick="javascript:return relatedtask_form_submit();">确定</a>
		<a class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" href="javascript:void(0)" onclick="javascript:$('#relatedtask_win_iframe').window('close');">取消</a>
	</div>
	
	<div data-options="region:'center',border:false" style="padding:20px;">
		<form name="relate_form" id="relate_form_cid" method="post">
			<div class="sys-msg-info"></div>
			<div class="css_config">
			<table>
			<tr id="conftr_0">
				<td class="label_grp"> </td>
				<td class="css_content"></td>
			</tr>
			<tbody id="group_1">
			  <tr id="conftr_type">
				<td class="label_1" style="width:100px;line-height:35px;">任务列表</td>
				<td class="css_content"><span class="select_margin"><select name="taskid" style="width:200px;"><option value="1">四季青</option></select></span>		</td>
			</tr>
			</tbody><!-- End group group_1 -->
			 </table>
			</div><!-- End css_conf -->
			<input type="hidden" name="targetmac" id="acconut_cid" value="$param[id]">
		</form>
	</div>
</div>
</div>

<SCRIPT LANGUAGE="JavaScript">
<!--
/*Tab link*/
$('#main_frame_tab').tabs({
  onSelect: function(title,index){
  }
});


radioToggle('cmd',['conftr_passwd','','']); 

var toolbar_tar_lock = [];

/*buttons handle*/

/*format column*/
function format_index(value){}
function format_name(value){return value}
function format_position(value){return value}
function format_add_time(value){return value}
function format_description(value){return value}
function format_status(value,data){
	switch(value){
		case 'start':
			return '进行中...'
		break;
		case 'fail':
			return '失败'+'<a href="javascript:void(0)" onclick="javascript:set_status()">下载破解文件</a>'
		break;
		case 'HONEYAP':
			return '蜜罐'
		break;
		default:
			return '<a href="javascript:void(0)" onclick="javascript:set_status(\''+data.BSSID+'\')">选择接入方式'+data.BSSID+'</a>'
		break;
	}

}
function format_type(value,data){
	switch(value){
		case 'LOGIN':
			return '已知用户名密码('+data.passwd+')';
		break;
		case 'CRACK':
			return '破解'			
		break;
		case 'HONEYAP':
			return '蜜罐'
		break;
		default:
			return '<a href="javascript:void(0)" onclick="javascript:set_status(\''+data.BSSID+'\')">选择接入方式</a>'
		break;
	}
}
function format_operation(value,data){return '<a href="javascript:void(0)"><img src="../public/images/default/icons/icon_del.gif" alt="删除" title="删除"></a>';}
function format_related(value,data){
	return '<a href="javascript:void(0)" onclick="javascript:set_related()">关联任务</a>';
}

function set_status(id){
	$("#aplist_cid").val(id);
	$("#targetlock_win_iframe").window('open');
}
function set_related(){	
	$("#relatedtask_win_iframe").window('open');
}
function targetlock_form_submit(){
	$.ajax({
	  type: 'POST',
	  url: 'targetlock-setstatus',
	  data: $("#access_form_cid").serialize(),
	  success: function(){},
	  dataType: 'json'
	});
	$("#targetlock_win_iframe").window('close');
	$('#target_lock_list').datagrid('reload');
}
function relatedtask_form_submit(){
	$.ajax({
	  type: 'POST',
	  url: 'targetlock-setrelate',
	  data: $("#relate_form_cid").serialize(),
	  success: function(){},
	  dataType: 'json'
	});

	$("#relatedtask_win_iframe").window('close');
	$('#acount_list').datagrid('reload');
}

function click_row_tar_lock(data){
	var row = $(this).datagrid('getSelected');

	$('#acount_list').datagrid({
		pageNumber:1,
		url:'?g=targetlock-client_data&BSSID='+row.BSSID+'&t='+Math.random()
	});

}
function tar_lock_loadsuccess(){
	var row = $(this).datagrid('getRows');
	
	$('#acount_list').datagrid({
		pageNumber:1,
		url:'?g=targetlock-client_data&BSSID='+row[0].BSSID+'&t='+Math.random()
	});
}
function accounut_loadsuccess(){
}
//-->
</SCRIPT>
</BODY>
</HTML> 
<!-- generate by hover ui system -->